package com.sch.wanandroid.adapter

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.core.text.HtmlCompat
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.sch.wanandroid.R
import com.sch.wanandroid.entity.CollectBean

/**
 * Created by Sch.
 * Date: 2020/4/26
 * description:我的收藏列表适配器
 */
class MyCollectAdapter : BaseQuickAdapter<CollectBean, BaseViewHolder>(R.layout.item_article) {
    override fun convert(holder: BaseViewHolder, item: CollectBean) {
        holder.setText(R.id.tvAuthor, item.author)
        holder.setText(
            R.id.tvTitle,
            HtmlCompat.fromHtml(item.title, HtmlCompat.FROM_HTML_MODE_LEGACY)
        )
        holder.setText(R.id.tvDate, item.niceDate)
        holder.setText(R.id.tvChapterName, item.chapterName)
        holder.setImageResource(
            R.id.ivCollect,
            R.drawable.ic_heart_red
        )
    }

}